<?php
class OrderManualFlushAction extends SzAbstractAction
{
    protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
    );

    /**
     * 手动重置完成次数（花钻）
     *
     * @param int $userId
     * @param int $position
     * @param int $reqTime
     * @return SzResponse
     */
    public function execute($userId, $position, $reqTime)
    {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_NORMAL_ORDER)) {
            return $this->buildResponse(false);
        }

        GameService::get()->validateMultiRequestTimeDelta($userId, $reqTime);

        OrderService::get()->manualFlushBuildingOrder($userId, $position);
        return $this->buildResponse(
            true
        );
    }
}